﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>

<script type="text/javascript">

    function Save() {

        $("#Msg").html("正在保存,请稍后......");

        var no = GetQueryString("OID");
        var checkBoxIDs = GenerCheckIDs(); //获得所有的 checkBox ID传入到后台去,用于解决checkbox控件，在没有被选择的时候，没有值的问题。
        // alert(CheckBoxIDs);
        var frmData = $("#cc").serialize();
        //alert(frmData);
        $.ajax({
            data: frmData,
            type: 'post',
            async: true,
            url: Handler + "?DoType=FrmFree_Save&CheckBoxIDs=" + checkBoxIDs + "&OID=" + no + "&m=" + Math.random(),
            dataType: 'html',
            success: function (data) {

                if (data.indexOf('err@') >= 0) {
                    $("#Msg").html("<font color=red>" + data + "</font>");
                    return;
                }

                $("#Msg").html("<font color=green>" + data + "</font>");
                var no = $('#TB_No').val();
                //window.location.href = 'Student.htm?No=' + no;
                return;
            }
        });
    }

    function Delete() {
        if (window.confirm('您确定要删除吗？') == false)
            return false;

        var oid = $("#TB_OID").val();
        $.ajax({
            type: 'post',
            async: true,
            url: Handler + "?DoType=Frm_Delete&OID=" + oid + "&m=" + Math.random(),
            dataType: 'html',
            success: function (data) {
                if (data.indexOf("err@") >= 0) {
                    alert(data);
                    return;
                }
                alert(data);
                window.close();
                return;
            }
        });
    }
</script>

</head>
<body>


<form id="cc">
<div id="Msg"> </div>

<input type=button value="新建" id="Btn_New" onclick="New()" />
<input type=button value="保存" id="Btn_Save" onclick="Save()" />
<input type=button value="删除" id="Btn_Delete" onclick="Delete()" />

</form>


</body>
</html>
